cmake_minimum_required(VERSION 3.12)

project(learn-asio)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

file(GLOB SOURCES *.cpp)

find_package(asio CONFIG REQUIRED)

foreach(SOURCE ${SOURCES})
	get_filename_component(PROGRAM ${SOURCE} NAME_WE)
	add_executable(${PROGRAM} ${SOURCE})
	target_link_libraries(${PROGRAM} PRIVATE asio::asio)
endforeach()
